<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>资讯动态 - 筛选浏览</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #2563eb;
            --primary-light: #3b82f6;
            --primary-dark: #1d4ed8;
            --gray-50: #f9fafb;
            --gray-100: #f3f4f6;
            --gray-200: #e5e7eb;
            --gray-300: #d1d5db;
            --gray-600: #4b5563;
            --gray-700: #374151;
            --text-primary: #111827;
            --text-secondary: #4b5563;
            --radius: 8px;
            --shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--gray-50);
            color: var(--text-primary);
            padding-top: 50px;
            padding-bottom: 60px;
            line-height: 1.5;
        }
        
        /* 导航栏样式 */
        .navbar {
            height: 50px;
            background-color: white;
            border-bottom: 1px solid var(--gray-200);
            padding: 0 15px;
        }
        
        .navbar-brand {
            color: var(--primary);
            font-weight: 600;
            font-size: 1.1rem;
        }
        
        .nav-actions {
            display: flex;
            gap: 15px;
            font-size: 1.1rem;
        }
        
        /* 搜索栏 */
        .search-container {
            padding: 12px 15px;
            background-color: white;
            border-bottom: 1px solid var(--gray-200);
        }
        
        .search-box {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 8px 15px 8px 40px;
            border: 1px solid var(--gray-200);
            border-radius: 20px;
            font-size: 0.9rem;
            background-color: var(--gray-50);
        }
        
        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray-600);
            font-size: 0.9rem;
        }
        
        /* 筛选工具栏 */
        .filter-toolbar {
            display: flex;
            align-items: center;
            padding: 8px 15px;
            background-color: white;
            border-bottom: 1px solid var(--gray-200);
            gap: 8px;
            overflow-x: auto;
            scrollbar-width: none;
        }
        
        .filter-toolbar::-webkit-scrollbar {
            display: none;
        }
        
        .filter-btn {
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 5px 12px;
            background-color: var(--gray-100);
            border: none;
            border-radius: 16px;
            font-size: 0.8rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }
        
        .filter-btn.active {
            background-color: var(--primary);
            color: white;
        }
        
        .filter-btn i {
            font-size: 0.9rem;
        }
        
        /* 高级筛选面板 */
        .advanced-filters {
            background-color: white;
            border-bottom: 1px solid var(--gray-200);
            padding: 10px 15px;
            display: none;
        }
        
        .advanced-filters.show {
            display: block;
        }
        
        .filter-section {
            margin-bottom: 12px;
        }
        
        .filter-title {
            font-size: 0.85rem;
            font-weight: 600;
            margin-bottom: 8px;
            color: var(--text-primary);
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .filter-option {
            padding: 4px 12px;
            background-color: var(--gray-100);
            border-radius: 14px;
            font-size: 0.8rem;
            color: var(--text-secondary);
            cursor: pointer;
        }
        
        .filter-option.active {
            background-color: var(--primary);
            color: white;
        }
        
        .filter-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding-top: 8px;
            border-top: 1px solid var(--gray-100);
        }
        
        .filter-action-btn {
            padding: 5px 16px;
            border-radius: 16px;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        .reset-btn {
            background-color: white;
            border: 1px solid var(--gray-300);
            color: var(--text-secondary);
        }
        
        .apply-btn {
            background-color: var(--primary);
            border: 1px solid var(--primary);
            color: white;
        }
        
        /* 分类标签 */
        .category-bar {
            overflow-x: auto;
            background-color: white;
            border-bottom: 1px solid var(--gray-200);
            padding: 10px 15px;
            scrollbar-width: none;
        }
        
        .category-bar::-webkit-scrollbar {
            display: none;
        }
        
        .category-item {
            padding: 5px 14px;
            margin-right: 8px;
            white-space: nowrap;
            border-radius: 16px;
            font-size: 0.85rem;
            color: var(--text-secondary);
            background-color: var(--gray-100);
        }
        
        .category-item.active {
            background-color: var(--primary);
            color: white;
        }
        
        /* 已选筛选条件 */
        .selected-filters {
            padding: 8px 15px;
            background-color: white;
            border-bottom: 1px solid var(--gray-200);
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        
        .selected-filter {
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 3px 10px;
            background-color: rgba(37, 99, 235, 0.1);
            color: var(--primary);
            border-radius: 14px;
            font-size: 0.8rem;
        }
        
        .remove-filter {
            cursor: pointer;
            font-size: 0.9rem;
        }
        
        .clear-all {
            margin-left: auto;
            font-size: 0.8rem;
            color: var(--gray-600);
            cursor: pointer;
        }
        
        /* 通用文章样式 */
        .news-section {
            margin-bottom: 15px;
        }
        
        .section-title {
            padding: 12px 15px;
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
        }
        
        .news-list {
            background-color: white;
        }
        
        .news-item {
            padding: 12px 15px;
            border-bottom: 1px solid var(--gray-100);
            transition: background-color 0.2s;
        }
        
        .news-item:last-child {
            border-bottom: none;
        }
        
        .news-item:hover {
            background-color: var(--gray-50);
        }
        
        .news-source {
            display: flex;
            align-items: center;
            margin-bottom: 8px;
            font-size: 0.8rem;
        }
        
        .source-name {
            color: var(--text-secondary);
            margin-right: 10px;
        }
        
        .publish-time {
            color: var(--gray-600);
            font-size: 0.75rem;
        }
        
        .news-title {
            font-weight: 500;
            margin-bottom: 8px;
            line-height: 1.4;
        }
        
        .news-excerpt {
            font-size: 0.85rem;
            color: var(--text-secondary);
            line-height: 1.5;
        }
        
        .news-actions {
            display: flex;
            justify-content: flex-end;
            gap: 15px;
            font-size: 0.75rem;
            color: var(--gray-600);
            margin-top: 10px;
        }
        
        .action-item {
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        /* 不同图片布局样式 */
        .no-image .news-title {
            font-size: 0.95rem;
        }
        
        .no-image .news-excerpt {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .single-image {
            width: 100%;
            border-radius: var(--radius);
            overflow: hidden;
            margin: 8px 0;
        }
        
        .single-image img {
            width: 100%;
            height: auto;
            display: block;
        }
        
        .left-small-image {
            display: flex;
            gap: 10px;
        }
        
        .small-image {
            width: 80px;
            height: 80px;
            border-radius: var(--radius);
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .small-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .small-image-content {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .left-small-image .news-title {
            font-size: 0.9rem;
            margin-bottom: auto;
        }
        
        .three-images {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px;
            margin: 8px 0;
            border-radius: var(--radius);
            overflow: hidden;
        }
        
        .three-images img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            aspect-ratio: 1/1;
        }
        
        /* 加载更多 */
        .load-more {
            padding: 15px;
            text-align: center;
        }
        
        .load-more-btn {
            background-color: white;
            border: 1px solid var(--primary);
            color: var(--primary);
            padding: 7px 20px;
            border-radius: 18px;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 55px;
            background-color: white;
            border-top: 1px solid var(--gray-200);
            display: flex;
            justify-content: space-around;
            align-items: center;
            z-index: 1000;
        }
        
        .nav-tab {
            display: flex;
            flex-direction: column;
            align-items: center;
            font-size: 0.65rem;
            color: var(--gray-600);
            text-decoration: none;
        }
        
        .nav-tab i {
            font-size: 1rem;
            margin-bottom: 3px;
        }
        
        .nav-tab.active {
            color: var(--primary);
        }
        
        /* 标签样式 */
        .news-tag {
            display: inline-block;
            padding: 1px 6px;
            font-size: 0.7rem;
            border-radius: 3px;
            margin-right: 5px;
        }
        
        .tag-hot {
            background-color: #fee2e2;
            color: #dc2626;
        }
        
        .tag-new {
            background-color: #dbeafe;
            color: #1e40af;
        }
        
        .tag-video {
            background-color: #e0f2fe;
            color: #0284c7;
        }
        
        /* 适配小屏幕 */
        @media (max-width: 320px) {
            .news-title {
                font-size: 0.9rem;
            }
            
            .small-image {
                width: 70px;
                height: 70px;
            }
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar fixed-top">
        <div class="container-fluid d-flex justify-content-between align-items-center">
            <span class="navbar-brand">资讯动态</span>
            <div class="nav-actions">
                <i class="fas fa-sliders-h" id="filterToggle"></i>
                <i class="fas fa-bell"></i>
            </div>
        </div>
    </nav>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-box">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索资讯、话题或作者...">
        </div>
    </div>
    
    <!-- 筛选工具栏 -->
    <div class="filter-toolbar">
        <button class="filter-btn active" data-filter="all">
            <i class="fas fa-th"></i> 全部
        </button>
        <button class="filter-btn" data-filter="text">
            <i class="fas fa-align-left"></i> 纯文字
        </button>
        <button class="filter-btn" data-filter="image">
            <i class="fas fa-image"></i> 有图
        </button>
        <button class="filter-btn" data-filter="video">
            <i class="fas fa-video"></i> 视频
        </button>
        <button class="filter-btn" data-sort="latest">
            <i class="fas fa-clock"></i> 最新
        </button>
        <button class="filter-btn" data-sort="hot">
            <i class="fas fa-fire"></i> 最热
        </button>
        <button class="filter-btn" data-filter="advanced">
            <i class="fas fa-filter"></i> 高级筛选
        </button>
    </div>
    
    <!-- 高级筛选面板 -->
    <div class="advanced-filters" id="advancedFilters">
        <div class="filter-section">
            <div class="filter-title">发布时间</div>
            <div class="filter-options">
                <div class="filter-option">今天</div>
                <div class="filter-option active">近3天</div>
                <div class="filter-option">近一周</div>
                <div class="filter-option">近一个月</div>
                <div class="filter-option">自定义</div>
            </div>
        </div>
        
        <div class="filter-section">
            <div class="filter-title">阅读量</div>
            <div class="filter-options">
                <div class="filter-option">1万以下</div>
                <div class="filter-option active">1-10万</div>
                <div class="filter-option">10-50万</div>
                <div class="filter-option">50万以上</div>
            </div>
        </div>
        
        <div class="filter-section">
            <div class="filter-title">来源类型</div>
            <div class="filter-options">
                <div class="filter-option active">全部来源</div>
                <div class="filter-option">官方媒体</div>
                <div class="filter-option">自媒体</div>
                <div class="filter-option">专家专栏</div>
                <div class="filter-option">用户分享</div>
            </div>
        </div>
        
        <div class="filter-actions">
            <button class="filter-action-btn reset-btn">重置</button>
            <button class="filter-action-btn apply-btn">应用筛选</button>
        </div>
    </div>
    
    <!-- 分类标签栏 -->
    <div class="category-bar d-flex">
        <div class="category-item active">全部</div>
        <div class="category-item">国内</div>
        <div class="category-item">国际</div>
        <div class="category-item">财经</div>
        <div class="category-item">科技</div>
        <div class="category-item">体育</div>
        <div class="category-item">娱乐</div>
        <div class="category-item">健康</div>
        <div class="category-item">教育</div>
    </div>
    
    <!-- 已选筛选条件 -->
    <div class="selected-filters">
        <div class="selected-filter">
            <span>有图</span>
            <i class="fas fa-times remove-filter"></i>
        </div>
        <div class="selected-filter">
            <span>近3天</span>
            <i class="fas fa-times remove-filter"></i>
        </div>
        <div class="selected-filter">
            <span>科技</span>
            <i class="fas fa-times remove-filter"></i>
        </div>
        <div class="clear-all">清除全部</div>
    </div>
    
    <!-- 资讯列表 -->
    <section class="news-section">
        <div class="news-list">
            <div class="news-item">
                <div class="news-source">
                    <span class="source-name">科技日报</span>
                    <span class="news-tag tag-new">新</span>
                    <span class="publish-time">2小时前</span>
                </div>
                <h3 class="news-title">2023世界人工智能大会开幕，多项前沿技术集中亮相</h3>
                <p class="news-excerpt">本次大会展示了人工智能在医疗、教育、制造业等多个领域的创新应用，包括自动驾驶、智能机器人、AI辅助诊断等前沿技术。</p>
                <div class="three-images">
                    <img src="https://picsum.photos/id/1/300" alt="AI大会1">
                    <img src="https://picsum.photos/id/2/300" alt="AI大会2">
                    <img src="https://picsum.photos/id/3/300" alt="AI大会3">
                </div>
                <div class="news-actions">
                    <div class="action-item"><i class="far fa-eye"></i> 13.7万</div>
                    <div class="action-item"><i class="far fa-comment"></i> 389</div>
                    <div class="action-item"><i class="far fa-share-square"></i> 256</div>
                </div>
            </div>
            
            <div class="news-item">
                <div class="news-source">
                    <span class="source-name">IT之家</span>
                    <span class="publish-time">1天前</span>
                </div>
                <h3 class="news-title">全球首条高温超导高速磁浮试验线建成通车</h3>
                <p class="news-excerpt">该试验线的建成标志着我国在高温超导磁浮技术领域取得重大突破，为未来超高速交通发展奠定了技术基础。</p>
                <div class="single-image">
                    <img src="https://picsum.photos/id/20/800/400" alt="磁浮列车">
                </div>
                <div class="news-actions">
                    <div class="action-item"><i class="far fa-eye"></i> 9.4万</div>
                    <div class="action-item"><i class="far fa-comment"></i> 421</div>
                    <div class="action-item"><i class="far fa-share-square"></i> 512</div>
                </div>
            </div>
            
            <div class="news-item left-small-image">
                <div class="small-image">
                    <img src="https://picsum.photos/id/180/300" alt="芯片技术">
                </div>
                <div class="small-image-content">
                    <div class="news-source">
                        <span class="source-name">半导体行业观察</span>
                        <span class="publish-time">2天前</span>
                    </div>
                    <h3 class="news-title">国产7纳米芯片量产取得重大进展，打破国外垄断</h3>
                    <div class="news-actions">
                        <div class="action-item"><i class="far fa-eye"></i> 21.2万</div>
                        <div class="action-item"><i class="far fa-comment"></i> 845</div>
                    </div>
                </div>
            </div>
            
            <div class="news-item no-image">
                <div class="news-source">
                    <span class="source-name">量子计算研究中心</span>
                    <span class="news-tag tag-hot">热点</span>
                    <span class="publish-time">3天前</span>
                </div>
                <h3 class="news-title">我国量子计算原型机"九章三号"实现255个光子操纵，计算能力再突破</h3>
                <p class="news-excerpt">最新研制的"九章三号"量子计算原型机在高斯玻色取样问题上实现255个光子操纵，计算能力较此前提升百万倍，再次刷新世界纪录。这一突破将推动量子计算向实用化方向迈进。</p>
                <div class="news-actions">
                    <div class="action-item"><i class="far fa-eye"></i> 15.8万</div>
                    <div class="action-item"><i class="far fa-comment"></i> 632</div>
                    <div class="action-item"><i class="far fa-share-square"></i> 418</div>
                </div>
            </div>
        </div>
    </section>
    
    <!-- 加载更多 -->
    <div class="load-more">
        <button class="load-more-btn">加载更多</button>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-tab active">
            <i class="fas fa-newspaper"></i>
            <span>资讯</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-compass"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-plus-circle"></i>
            <span>发布</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-bell"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 筛选工具栏切换
        const filterButtons = document.querySelectorAll('.filter-btn');
        filterButtons.forEach(button => {
            button.addEventListener('click', () => {
                // 处理高级筛选按钮
                if (button.getAttribute('data-filter') === 'advanced') {
                    document.getElementById('advancedFilters').classList.toggle('show');
                    return;
                }
                
                // 处理分类筛选
                if (button.getAttribute('data-filter')) {
                    filterButtons.forEach(btn => {
                        if (btn.getAttribute('data-filter') && btn.getAttribute('data-filter') !== 'advanced') {
                            btn.classList.remove('active');
                        }
                    });
                    button.classList.add('active');
                }
                
                // 处理排序筛选（可同时选中一个排序和一个内容筛选）
                if (button.getAttribute('data-sort')) {
                    filterButtons.forEach(btn => {
                        if (btn.getAttribute('data-sort')) {
                            btn.classList.remove('active');
                        }
                    });
                    button.classList.add('active');
                }
                
                // 实际筛选逻辑
                applyFilters();
            });
        });
        
        // 高级筛选选项切换
        const filterOptions = document.querySelectorAll('.filter-option');
        filterOptions.forEach(option => {
            option.addEventListener('click', () => {
                // 同一组筛选选项只能选一个
                const parent = option.parentElement;
                parent.querySelectorAll('.filter-option').forEach(opt => {
                    opt.classList.remove('active');
                });
                option.classList.add('active');
            });
        });
        
        // 应用高级筛选
        document.querySelector('.apply-btn').addEventListener('click', () => {
            document.getElementById('advancedFilters').classList.remove('show');
            applyFilters();
            updateSelectedFilters();
        });
        
        // 重置高级筛选
        document.querySelector('.reset-btn').addEventListener('click', () => {
            document.querySelectorAll('.filter-option').forEach(option => {
                option.classList.remove('active');
            });
            // 默认选中第一个选项
            document.querySelectorAll('.filter-options').forEach(options => {
                options.querySelector('.filter-option').classList.add('active');
            });
        });
        
        // 分类标签切换
        const categoryItems = document.querySelectorAll('.category-item');
        categoryItems.forEach(item => {
            item.addEventListener('click', () => {
                categoryItems.forEach(i => i.classList.remove('active'));
                item.classList.add('active');
                applyFilters();
                updateSelectedFilters();
            });
        });
        
        // 移除单个筛选条件
        const removeFilters = document.querySelectorAll('.remove-filter');
        removeFilters.forEach(removeBtn => {
            removeBtn.addEventListener('click', () => {
                removeBtn.parentElement.remove();
                // 如果没有筛选条件了，隐藏整个容器
                if (document.querySelectorAll('.selected-filter').length === 0) {
                    document.querySelector('.selected-filters').style.display = 'none';
                }
                resetCorrespondingFilter(removeBtn.previousElementSibling.textContent);
            });
        });
        
        // 清除所有筛选条件
        document.querySelector('.clear-all').addEventListener('click', () => {
            document.querySelectorAll('.selected-filter').forEach(filter => {
                filter.remove();
            });
            document.querySelector('.selected-filters').style.display = 'none';
            
            // 重置所有筛选条件
            filterButtons.forEach(btn => {
                btn.classList.remove('active');
            });
            document.querySelector('.filter-btn[data-filter="all"]').classList.add('active');
            
            categoryItems.forEach(item => {
                item.classList.remove('active');
            });
            document.querySelector('.category-item').classList.add('active');
            
            applyFilters();
        });
        
        // 高级筛选面板切换
        document.getElementById('filterToggle').addEventListener('click', () => {
            document.getElementById('advancedFilters').classList.toggle('show');
        });
        
        // 加载更多功能
        const loadMoreBtn = document.querySelector('.load-more-btn');
        loadMoreBtn.addEventListener('click', () => {
            loadMoreBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 加载中...';
            
            // 模拟加载延迟
            setTimeout(() => {
                loadMoreBtn.textContent = '加载更多';
                // 实际项目中添加加载更多内容逻辑
            }, 1500);
        });
        
        // 底部导航切换
        const navTabs = document.querySelectorAll('.nav-tab');
        navTabs.forEach(tab => {
            tab.addEventListener('click', (e) => {
                e.preventDefault();
                navTabs.forEach(t => t.classList.remove('active'));
                tab.classList.add('active');
            });
        });
        
        // 点击新闻项进入详情
        const newsItems = document.querySelectorAll('.news-item');
        newsItems.forEach(item => {
            item.addEventListener('click', () => {
                // 跳转到新闻详情页
                console.log('进入新闻详情页');
            });
        });
        
        // 应用筛选条件（实际项目中会根据筛选条件请求数据）
        function applyFilters() {
            // 获取当前选中的筛选条件
            const activeFilter = document.querySelector('.filter-btn[data-filter].active')?.getAttribute('data-filter');
            const activeSort = document.querySelector('.filter-btn[data-sort].active')?.getAttribute('data-sort');
            const activeCategory = document.querySelector('.category-item.active')?.textContent;
            
            console.log('应用筛选条件:');
            console.log('内容筛选:', activeFilter);
            console.log('排序方式:', activeSort);
            console.log('分类:', activeCategory);
            
            // 这里添加实际筛选逻辑
        }
        
        // 更新已选筛选条件显示
        function updateSelectedFilters() {
            // 显示筛选条件容器
            document.querySelector('.selected-filters').style.display = 'flex';
            
            // 实际项目中会根据当前选中的筛选条件动态生成
            // 这里只是演示
        }
        
        // 重置对应的筛选条件
        function resetCorrespondingFilter(filterText) {
            console.log('移除筛选条件:', filterText);
            
            // 实际项目中根据筛选条件文本找到对应的筛选器并重置
        }
    </script>
</body>
</html>
    
